package com.dg.cuckoo.admin.repository;

import com.dg.cuckoo.admin.dto.proCarryOut.AppropriationDto;
import com.dg.cuckoo.admin.dto.proCarryOut.ProCarryOutDto;
import com.dg.cuckoo.core.BaseRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface AppropriationRepository extends BaseRepository<AppropriationDto,String> {

    List<AppropriationDto> findByProjectIdAndType(String projectId,Integer type);

    @Query(value = "select * from appropriation where type=? and project_id=? limit ?,?",nativeQuery = true)
    List<AppropriationDto> page(Integer type, String projectId, Integer page, Integer pageSize);

    @Query(value = "select * from appropriation where project_id=? limit ?,?",nativeQuery = true)
    List<AppropriationDto> pageAll(String projectId, Integer page, Integer pageSize);

    List<AppropriationDto> findByProjectId(String projectId);
}
